export const customRequest = async (fn: Function, callback?: () => void | boolean ) => {
  try {
    const res: any = await fn();
    const bool = callback && callback();
    if (res.code != 200) {
      bool || ElMessage.error(res.msg);
      throw res.msg;
    }
    // console.log(res);
    bool || ElMessage.success(res.msg); //设置是否发消息,true为不发
    return res.data;
  } catch (err: any) {
    throw err;
  }
};
